home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc™ Source Code / Storage / Bento / PrmRslvr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-28  |  1.5 KB  |  87 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        PrmRslvr.h
  3.  
  4.     Contains:    PromiseResolver header
  5.  
  6.     Written by:    Vincent Lo
  7.  
  8.     Copyright:    © 1994 - 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <3>     4/10/95    VL        1236490: Made GetPromiseValue work during
  13.                                     FulfillPromise.
  14.          <2>     3/14/95    VL        1225208,1225201: Added IsSettingPromise to
  15.                                     ensure that we don't call ResolvePromise
  16.                                     while setting a promise.
  17.          <1>     7/26/94    VL        first checked in
  18.     To Do:
  19. */
  20.  
  21. #ifndef _PRMRSLVR_
  22. #define _PRMRSLVR_
  23.  
  24. #ifndef _ODTYPES_
  25. #include <ODTypes.h>
  26. #endif
  27.  
  28. #ifndef __CM_API__
  29. #include <CMAPI.h>
  30. #endif
  31.  
  32. typedef struct {
  33.     ODPart*                sourcePart;
  34.     ProcessSerialNumber sourcePSN;
  35. } ODValueRefCon;
  36.  
  37. class CMStorageUnit;
  38. class ODPart;
  39.  
  40. class PromiseResolver 
  41. {
  42. public:
  43.  
  44.     PromiseResolver();
  45.     
  46.     ~PromiseResolver();
  47.     
  48.     void InitPromiseResolver(CMStorageUnit* su);
  49.  
  50.     ODBoolean IsPromiseValue(Environment* ev);
  51.  
  52.     void SetSourcePart(Environment* ev,
  53.                         ODPart *sourcePart);
  54.  
  55.     ODPart* GetSourcePart(Environment* ev);
  56.  
  57.     void ClearPromise(Environment* ev);
  58.  
  59.     void ResolvePromise(Environment* ev);
  60.  
  61.     ODULong GetPromiseCount();
  62.     
  63.     void SettingPromise();
  64.     
  65.     void DoneSettingPromise();
  66.     
  67.     ODBoolean IsSettingPromise();
  68.     
  69. protected:
  70.  
  71.     ODPtr GetPromiseInfo(CMValue curValue);
  72.  
  73.     void SetPromiseInfo(CMValue curValue, ODPtr theInfo);
  74.     
  75.     void IncrementPromiseCount();
  76.     
  77.     void DecrementPromiseCount();
  78.     
  79.     ODULong        fPromiseCount;
  80.     CMStorageUnit*    fSU;
  81.     ODBoolean    fSettingPromise;
  82.     ODValueRefCon*    fResolvingPromiseInfo;
  83. };
  84.  
  85.  
  86. #endif    // _PRMRSLVR_
  87.